<html>

<head>
    <script type="text/javascript">
        function say() {
            alert("one.html");
        }
        function callChild() {
            var myFrame = document.getElementById("myFrame");
            console.log('myFrame',myFrame);
            var myFrameWindow = myFrame.contentWindow;
            console.log('myFrameWindow',myFrameWindow);
            myFrameWindow.say();
            myFrameWindow.document.getElementById("button").value = "调用结束";
        }
    </script>
</head>

<body>
    <input id="button" type="button" value="调用tow.html中的函数say()" onclick="callChild()" />
    <iframe src="http://127.0.0.1:8080/siteB/tow.html" name="myFrame" id="myFrame"></iframe>
</body>
<script>

</script>

</html>